﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Cricket.LinqModel;
using Cricket.LinqData;

public partial class Logout : System.Web.UI.Page
{
    IDataRepository _dataObject = new DataRepository();
    Client client;
    protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie cookie = Request.Cookies["Client"];
        client = new Client(_dataObject);
        client.Id = Convert.ToInt32(cookie["ClientId"]);
        client.IsLogin = false;
        client.UpdateIsLoginForClient();
        if (cookie != null)
            Response.Cookies["Client"].Expires = DateTime.Now.AddDays(-1);

        

        Response.Redirect("Login.aspx");
    }
}